package web_middleware

import (
	"github.com/gogf/gf/net/ghttp"
)

// CorsMiddleware 允许跨域请求中间件
func CorsMiddleware(r *ghttp.Request) {

	corsOptions := r.Response.DefaultCORSOptions()
	corsOptions.AllowDomain = []string{"*"}
	r.Response.CORS(corsOptions)
	r.Middleware.Next()
}
